<?
$this->placeholder('page_title')->set('Syner-G Resources');
$grid_options = array('width' => 600);

$filename = dirname(__FILE__) . '/resources_grid.ini';
$col = new Zend_Config_Ini($filename, 'columns');

$this->headScript()->captureStart();
?>
function synerg_resource_edit_formatter(p)
{
    return '<a href="<?= $this->baseUrl() ?>/admin/synerg/resourcesedititem/id/'
        + p + '"><img src="<?= $this->baseUrl() ?>/images/icons/edit.gif" height="20" width="20" border="0"/></a>';
}

function synerg_resource_view_formatter(p)
{
    return '<a href="<?= $this->baseUrl() ?>/admin/synerg/resourcesviewitem/id/'
        + p + '"><img src="<?= $this->baseUrl() ?>/images/icons/view.gif" height="20" width="20" border="0"/></a>';
}

function synerg_resource_delete_formatter(p)
{
    return '<a href="<?= $this->baseUrl() ?>/admin/synerg/resourcesviewitem/id/'
        + p + '"><img src="<?= $this->baseUrl() ?>/images/icons/delete.gif" height="20" width="20" border="0"/></a>';
}

function unity_year(y)
{
    return new String(y).replace(/^20/, '');
}

var ugd_months = [
  ,
  'Jan',
  'Feb',
  'Mar',
  'Apr',
  'May',
  'Jun',
  'Jul',
  'Aug',
  'Sep',
  'Oct',
  'Nov',
  'Dec'
];

function grid_date_formatter(pDate)
{
    hits = new String(pDate).match(/([\d]{4})-([\d]{2})-([\d]{2})/)
    if (hits)
    {
	var out = ugd_months[new Number(hits[2]).valueOf()] + '&nbsp;' + new Number(hits[3]).valueOf() + '&nbsp;' + unity_year(hits[1]);

	return out;
    }
    else
    {
	return pDate;
    }
}

<?  $this->headScript()->captureEnd();   ?>

<?= $this->dojostore('resources_store', $this->baseUrl() . '/admin/synerg/resourcesstore') ?>
<?= $this->dojogrid( 'resources_grid', 'resources_store', $col, 'id', NULL, $grid_options) ?>

<hr />

<?= $this->zupallinkbutton('/admin/synerg/resourcesnewitem/resourceclass/resources',
    'New Resource') ?>


<?= $this->zupallinkbutton('/admin/synerg/resourcesnewitem/resourceclass/group',
    'New Group') ?>


<?= $this->zupallinkbutton('/admin/synerg/resourcesnewitem/resourceclass/sm',
    'New Social Metric') ?>
